using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_MeasureUnitMap : EntityTypeConfiguration<t_MeasureUnit>
    {
        public t_MeasureUnitMap()
        {
            // Primary Key
            this.HasKey(t => t.FMeasureUnitID);

            // Properties
            this.Property(t => t.FMeasureUnitID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FNumber)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.FAuxClass)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FBrNo)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.FShortNumber)
                .HasMaxLength(30);

            this.Property(t => t.FOperDate)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.FModifyTime)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            this.Property(t => t.FNameEN)
                .HasMaxLength(255);

            this.Property(t => t.FNameEnPlu)
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("t_MeasureUnit");
            this.Property(t => t.FMeasureUnitID).HasColumnName("FMeasureUnitID");
            this.Property(t => t.FUnitGroupID).HasColumnName("FUnitGroupID");
            this.Property(t => t.FNumber).HasColumnName("FNumber");
            this.Property(t => t.FAuxClass).HasColumnName("FAuxClass");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FConversation).HasColumnName("FConversation");
            this.Property(t => t.FCoefficient).HasColumnName("FCoefficient");
            this.Property(t => t.FPrecision).HasColumnName("FPrecision");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FParentID).HasColumnName("FParentID");
            this.Property(t => t.FDeleted).HasColumnName("FDeleted");
            this.Property(t => t.FShortNumber).HasColumnName("FShortNumber");
            this.Property(t => t.FOperDate).HasColumnName("FOperDate");
            this.Property(t => t.FScale).HasColumnName("FScale");
            this.Property(t => t.FStandard).HasColumnName("FStandard");
            this.Property(t => t.FControl).HasColumnName("FControl");
            this.Property(t => t.FModifyTime).HasColumnName("FModifyTime");
            this.Property(t => t.FSystemType).HasColumnName("FSystemType");
            this.Property(t => t.UUID).HasColumnName("UUID");
            this.Property(t => t.FNameEN).HasColumnName("FNameEN");
            this.Property(t => t.FNameEnPlu).HasColumnName("FNameEnPlu");
        }
    }
}
